home *** CD-ROM | disk | FTP | other *** search
/ Freelog 38 / Freelog038.iso / Bas / Bureautique / Ntl480 / Setup.exe / {app} / Libraries / TopStyle.clb < prev    next >
Text File  |  2002-06-10  |  4KB  |  156 lines

  1. = V5 MultiLine NoSorting TabWidth=30
  2.  
  3. H=";About this library"
  4. This library was written by Fookes Software to serve as a demonstration of the varied tasks that can be performed by the Editor Clipbook. You are free to customize it any way you like!
  5.  
  6. The Clips provided in this library require Bradsoft's TopStyle CSS editor, version 1.51 or above.  For more information about TopStyle, please visit the TopStyle home page at:
  7.  
  8.     http://www.bradsoft.com/topstyle/
  9.  
  10. If you have a useful Clipbook library that you would like to share with other NoteTab users, please submit it to: <clipbook@fookes.com>. Your library will then be added to the Clipbook repository on the web.
  11.  
  12.  
  13. H="; "
  14.  
  15.  
  16. H="TopStyle Home Page"
  17. ^!URL http://www.bradsoft.com/redir.asp?id=130
  18.  
  19. H="Download TopStyle"
  20. ^!URL http://www.bradsoft.com/redir.asp?id=131
  21.  
  22. H="; "
  23.  
  24.  
  25. H="Edit Style Block"
  26. ;Is TopStyle available? Clip ends if not.
  27. ^!Clip "Check TopStyle Enabled"
  28.  
  29. ;Don't select the <style>..</style> tags!
  30. ^!Set %Str%=^$GetSelection$
  31. ^!IfTrue ^$IsEmpty(^%Str%)$ FindTag
  32.  
  33. ^!Set %StyleStart%=^$GetRowStart$:^$GetColStart$
  34. ^!Set %StyleEnd%=^$GetRowEnd$:^$GetColEnd$
  35. ^!Goto CheckCommentTag
  36.  
  37. :FindTag
  38. ^!Find "<style>" TIWS
  39. ^!IfError Next ELSE EndTag
  40. ^!Find "<style" TIWSC
  41. ^!IfError InformError
  42. ^!Find ">" TIS
  43. ^!IfError InformError
  44.  
  45. :EndTag
  46. ^!Jump SELECT_END
  47. ^!Set %StyleStart%=^$GetRow$:^$GetCol$
  48. ^!Find "</style>" TIWS
  49. ^!IfError InformError
  50. ^!Jump SELECT_START
  51. ^!Set %StyleEnd%=^$GetRow$:^$GetCol$
  52. ^!SelectTo ^%StyleStart%
  53.  
  54. :CheckCommentTag
  55. ^!Find "<!--" TIHS
  56. ^!IfError Start
  57. ^!Jump SELECT_END
  58. ^!Set %StyleStart%=^$GetRow$:^$GetCol$
  59. ^!Find "-->" TIS
  60. ^!IfError ^!SetCursor ^%StyleEnd%
  61. ^!Jump SELECT_START
  62. ^!SelectTo ^%StyleStart%
  63.  
  64. :Start
  65. ^!Set %Str%=^$GetSelection$
  66. ;Invoke the TopStyle editor
  67. ^!Set %StrNew%=^$EditStyleBlock(^%Str%)$
  68. ;Check if style values have changed. If not, end procedure
  69. ^!IfSame "^%Str%" "^%StrNew%" End
  70. ;Temporarily turn off automatic indenting (if it is enabled)
  71. ^!SetPasteIndent Off
  72. ^!InsertText ^%StrNew%
  73. ^!Goto End
  74.  
  75. :InformError
  76. ^!Prompt Please select the style block you want to edit
  77.  
  78. H="Edit Style Attribute"
  79. ;Is TopStyle available? Clip ends if not.
  80. ^!Clip "Check TopStyle Enabled"
  81.  
  82. ;Don't select the quote marks!
  83. ^!Set %Str%=^$GetSelection$
  84. ;If no text was selected, retrieve all text between quotes
  85. ^!IfFalse ^$IsEmpty(^%Str%)$ Start
  86. ^!Set %Str%=^$GetQuoteBlock(True)$
  87. ^!IfTrue ^$IsEmpty(^%Str%)$ InformError
  88.  
  89. :Start
  90. ;Invoke the TopStyle editor
  91. ^!Set %StrNew%=^$EditStyleAttr("^%Str%")$
  92. ;Check if attribute values have changed. If not, end procedure
  93. ^!IfSame "^%Str%" "^%StrNew%" End
  94. ;Temporarily turn off automatic indenting (if it is enabled)
  95. ^!SetPasteIndent Off
  96. ;Insert modified attribute
  97. ^!InsertText ^%StrNew%
  98. ^!Goto End
  99.  
  100. :InformError
  101. ^!Prompt Please select the Style attribute you want to edit
  102.  
  103. H="Open <LINK> Style Sheet"
  104. ;Is TopStyle available? Clip ends if not.
  105. ^!Clip "Check TopStyle Enabled"
  106.  
  107. ;Select tag at cursor position
  108. ^!Set %Str%=^$GetHtmlTag(True)$
  109. ;Check if valid LINK tag
  110. ^!If ^$StrPos("link";"^%Str%";No)$ = 0 InformError
  111. ^!If ^$StrPos("stylesheet";"^%Str%";No)$ = 0 InformError
  112. ;Select HREF attribute
  113. ^!Find "href" CIHS
  114. ^!IfError InformError
  115. ^!Jump SELECT_END
  116. ^!MoveCursor +3
  117. ^!Select FileName
  118. ^!Set %Str%=^$GetSelection$
  119. ^!IfTrue ^$IsEmpty(^%Str%)$ InformError
  120.  
  121. ;Invoke the TopStyle editor
  122. ^!EditStyleSheet ^%Str%
  123. ^!IfError ^!Prompt Error: file "^%Str%" not found
  124. ^!Goto End
  125.  
  126. :InformError
  127. ^!Prompt Please select the LINK tag defining the Style Sheet you want to edit
  128.  
  129. H="Edit Style Sheet"
  130. ;Is TopStyle available? Clip ends if not.
  131. ^!Clip "Check TopStyle Enabled"
  132.  
  133. ;Invoke the TopStyle editor
  134. ^!EditStyleSheet ^**
  135.  
  136.  
  137. H="; "
  138.  
  139.  
  140. H="Open TopStyle"
  141. ;Is TopStyle available? Clip ends if not.
  142. ^!Clip "Check TopStyle Enabled"
  143.  
  144. ;Open the TopStyle editor
  145. ^!EditStyleSheet
  146.  
  147.  
  148. H="; "
  149.  
  150.  
  151. H="_Check TopStyle Enabled"
  152. ^!IfTrue ^$IsTopStyleEnabled$ End
  153. ^!Continue This Clip requires Bradsoft's TopStyle CSS editor, version 1.51 or later.  Click OK to visit Bradsoft's web site for more information about TopStyle, or click Cancel to abort.
  154. ^!URL http://www.bradsoft.com/redir.asp?id=130
  155. ^!Goto Exit
  156.